<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增跟踪标签')" />
</head>
<body>
    <div class="main-content">
        <form id="form-user-add" class="form-horizontal">
            <div class="row">
            	<div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-2 control-label is-required">名称：</label>
                        <div class="col-sm-8">
                            <input name="name" placeholder="请输入名称" class="form-control" type="text" maxlength="30" required>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">显示：</label>
                        <div class="col-sm-8">
                            <label class="toggle-switch switch-solid"><input type="checkbox" id="isInChlog" checked><span></span></label>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
	<th:block th:include="include :: footer" />
	<script>
	    var prefix = ctx + "project/setting";
	
        function submitHandler() {
	        if ($.validate.form()) {
	        	var data = $("#form-user-add").serializeArray();
	        	var isInChlog = $("input[id='isInChlog']").is(':checked') == true ? 0 : 1;
	        	data.push({"name": "isInChlog", "value": isInChlog});
	        	$.operate.save(prefix + "/saveTracker", data);
	        }
	    }
    </script>
</body>
</html>